﻿using System.Data;

namespace Ledict.ConditionExtract.IDAL
{
    /// <summary>
    /// Tree数据操作接口
    /// </summary>
    public interface ITreeDateDAL 
    {
        /// <summary>
        /// 得到节点的下级
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        DataTable NodeTree_Tree(string pid);

        /// <summary>
        /// 得到节点的下级
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        DataTable GetSourceTree(string pid);

        ///// <summary>
        ///// 下级来源树
        ///// </summary>
        ///// <param name="pId">父ID</param>
        ///// <returns></returns>
        //DataTable GetSourceTree_New(string pId);

        /// <summary>
        /// 下级来源树
        /// </summary>
        /// <param name="pId">父ID</param>
        /// <param name="level">层级,默认是1</param>
        /// <returns></returns>
        DataTable GetSourceTreeChild(string pId, int level = 1);

        /// <summary>
        /// 得到节点的下级个数
        /// </summary>
        /// <param name="pid"></param>                 
        /// <returns></returns>
        int GetChildType(string pid, int ptype, int TableName);

        /// <summary>
        /// 得到节点的下级
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        DataTable GetCauseTree_Two(string pid, int effective);

        DataTable GetCauseTreeTwo_ToExpressTab(string pid, int effective);
        DataTable GetCauseTreeTwo_ToExpressTab_Virtual(string pid, int CC_IsCombination);
        DataTable GetCauseTreeThree_ToExpressTab_Virtual(string pid, int CC_IsCombination);

        /// <summary>
        /// 得到节点的下级
        /// </summary>
        /// <param name="pid"></param>
        /// <returns></returns>
        DataTable GetTreeHeadWords(string pid, string Tname);

        string GetHeadWordAllPid(string headword);

        /// <summary>
        /// 根据案由ID字符串，获取案由的所有父级节点列表 add by zhangpeng
        /// </summary>
        /// <param name="headwords">案由ID字符串，eg：1181,1655</param>
        /// <returns></returns>
        DataTable GetHeadWordAllPids(string headwords);

        /// <summary>
        /// 查新节点树
        /// </summary>
        /// <param name="FirPid"></param>
        /// <param name="name"></param>
        /// <param name="TreeNumber"></param>
        /// <returns></returns>
        DataTable NodeTree_TreeQuery(string FirPid, string name, int TreeNumber);

        string GetAllParentNode(string id);

        /// <summary>
        /// 根据父节点，获取案例类别
        /// </summary>
        /// <param name="parentId">父节点</param>
        /// <returns></returns>
        DataTable GetCaseCategory(string parentId);

        /// <summary>
        /// 根据节点名称，获取当前节点及所有子节点
        /// </summary>
        /// <param name="ccName">节点名称</param>
        /// <returns></returns>
        DataTable AllGetCaseCause(string ccName);

        /// <summary>
        /// 得到节点的下级(SYS_CaseType_DocType) add by zhangpeng 2016-09-12 
        /// </summary>
        /// <param name="ctCode"></param>
        /// <param name="cdDocType"></param>
        /// <param name="cdFileType"></param>
        /// <returns></returns>
        DataTable GetSourceTree_New(string ctCode = null, string cdDocType = null, string cdFileType = null);

        /// <summary>
        /// 根据CCID，获取当前节点及所有子节点
        /// </summary>
        /// <param name="ccName">节点名称</param>
        /// <returns></returns>
        DataTable AllGetCaseCauseByCCID(string ccId);

    }
}
